<?php

defined("_ARKN_EXEC") or exit("no no, mr. superman no here");
($_SESSION["roleid"] == Roles::Secretary) or exit("you almost got away with it");
require ROOT_FOLDER . "/php/pages/menu_strip.php";
require_once ROOT_FOLDER . "/php/scripts/account_scripts/Account.php";

$email = $_POST["email"];
$success = $account->findstudent($firstname, $lastname, $address, $email);
if(!$success) {
	print("Student not found.");
	exit ;
}
?>

<br />
<br />
<form method="post" action="<?php print(ROOT_ADDRESS . "?page=run_editstudent"); ?>" id="login_form">
	<fieldset>
		<legend>
			Edit Student
		</legend>
		<table>
			<tr>
				<td>First Name:</td>
				<td>
				<input class="credential_input" type="text" value="<?php print(htmlEsc($firstname)); ?>" name="firstname" id="firstname" readonly="readonly"/>
				</td>
			</tr>
			<tr>
				<td>Last Name:</td>
				<td>
				<input class="credential_input" type="text" value="<?php print(htmlEsc($lastname)); ?>" name="lastname" id="lastname" readonly="readonly"/>
				</td>
			</tr>
			<tr>
				<td>Current Address:</td>
				<td>
				<input class="credential_input" type="text" value="<?php print(htmlEsc($address)); ?>" name="currentaddress" id="currentaddress" readonly="readonly"/>
				</td>
			</tr>
			<tr>
				<td>New Address:</td>
				<td>
				<input class="credential_input" type="text" name="newaddress" id="newaddress"/>
				</td>
			</tr>
			<tr>
				<td>Current Email:</td>
				<td>
				<input class="credential_input" type="text" value=<?php print(htmlEsc($email)); ?> name="currentemail" id="currentemail" readonly="readonly"/>
				</td>
			</tr>
			<tr>
				<td>New Email:</td>
				<td>
				<input class="credential_input" type="text" name="newemail" id="newemail"/>
				</td>
			</tr>
			<tr>
				<td colspan="2">
				<input class="credential_submit_btn" type="submit" name="btnEditStudent" value="Edit Student"/>
				</td>
			</tr>
		</table>
	</fieldset>
</form>